package tech.aistar.wyymusicplayer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.aistar.wyymusicplayer.pojo.Result;
import tech.aistar.wyymusicplayer.service.PlaylistService;
import tech.aistar.wyymusicplayer.service.UserService;


@RestController // = @ResponseBody + @Controller
@RequestMapping("playlist")
public class PlaylistController {
    @Autowired
    private PlaylistService playlistService;

    @Autowired
    private RedisTemplate redisTemplate;

    @GetMapping
    public Result showPlaylist(String languageType){
        switch (languageType){
            case "华语" :
                return new Result("200","返回华语歌曲",playlistService.FindByChinese());
            case "英语" :
                return new Result("200","返回英语歌曲",playlistService.FindByEnglish());
            case "韩语" :
                return new Result("200","返回韩语歌曲",playlistService.FindByKorean());
            case "日语" :
                return new Result("200","返回日语歌曲",playlistService.FindByJapanese());
            default:
                return new Result("200","返回全部歌曲",playlistService.FindAll());
        }
    }
}
